import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import axios from 'axios'
import * as echarts from 'echarts'


Vue.prototype.$echarts = echarts;
// 请求拦截器
axios.interceptors.request.use(
    config => {
      // 可以在这里添加认证token等
      const token = localStorage.getItem('jwttoken'); // 假设这是你的认证token
      config.headers.jwttoken = token;

      return config;
    },
    error => {
      // 对请求错误做些什么
      return Promise.reject(error);
    }
);

const instance = axios.create({
    withCredentials: true // 设置 withCredentials 为 true
});

Vue.prototype.axios=axios

Vue.config.productionTip = false
Vue.use(ElementUI);

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
